package com.info.zhiduoduo.repository.entity.crowdsource;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * @author tianyonghong
 * @create 2023/9/25
 */
@Data
@Accessors(chain = true)
@TableName("zdd_upload_file_task_record")
public class UploadFileTaskRecord extends Model<UploadFileTaskRecord> {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("文件类型 1:企业导入自然人 2:企业导入智众包 3:企业导入智零工")
    @TableField("file_type")
    private Integer fileType;

    @ApiModelProperty("企业ID")
    @TableField("compid")
    private Integer compid;

    @ApiModelProperty("导入文件")
    @TableField("file_path")
    private String filePath;

    @ApiModelProperty("处理总条数")
    @TableField("total_num")
    private Integer totalNum;

    @ApiModelProperty("成功条数")
    @TableField("success_num")
    private Integer successNum;

    @ApiModelProperty("失败条数")
    @TableField("fail_num")
    private Integer failNum;

    @ApiModelProperty("任务状态1创建 2处理中 3处理异常中断 4处理完成")
    @TableField("state")
    private Integer state;

    @ApiModelProperty("异常描述")
    @TableField("error_msg")
    private String errorMsg;

    @ApiModelProperty("错误数据文件下载地址")
    @TableField("error_file_path")
    private String errorFilePath;

    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新时间
     */
    private Date updateTime;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
